let wxLogin = (successCallBack, failureCallBack) => {
    wx.login({
        success: function(res) {
            successCallBack(res);
        },
        fail: function(err) {
            failureCallBack(err);
        }
    });
};
let wxUserInfo = (successCallBack, failureCallBack) => {
    wx.getSetting({
        success: res => {
            if (res.authSetting["scope.userInfo"]) {
                // 已获取授权
                wx.getUserInfo({
                    success: res => {
                        successCallBack(res);
                    }
                });
            } else {
                failureCallBack("用户未授权");
            }
        },
        fail: error => {
            failureCallBack(error)
        }
    });
};
export default {
    wxLogin,
    wxUserInfo
};
